<template>
  <div class="comments">
    <div class="commentsTop">
      <div class="left">
        <i class="iconfont icon-fanhui" @click="$router.go(-1)"></i>
        <span>评论({{ comments.commentCount }})</span>
      </div>
      <div class="iconfont icon-fenxiang right"></div>
    </div>
    <div class="play">
      <div class="img">
        <img :src="comments.coverImgUrl" alt="" />
      </div>
      <div class="cont">
        <h5>{{ comments.name }}</h5>
        <p>
          by <span>{{ comments.creator.nickname }}</span>
        </p>
      </div>
      <div class="icon">
        <i class="iconfont icon-xiayiyehouyiye"></i>
      </div>
    </div>
    <div class="fg"></div>
    <div class="commennav">
      <van-sticky :offset-top="50">
        <div class="navitem">
          <div class="itemleft">评论区</div>
          <div class="itemright">
            <ul>
              <router-link replace tag="li" :to="{path:'/comments/recommendedComments',query:{
  playlist: comments
              }}" active-class="active">推荐
              </router-link>
              <router-link replace tag="li" :to="{
                path: '/comments/theHottestComments', query: {
                  playlist: comments
                }
              }" active-class="active">最热
              </router-link>
              <router-link replace tag="li" :to="{
                path: '/comments/theLatestComments', query: {
                  playlist: comments
                }
              }" active-class="active">最新
              </router-link>
            </ul>
          </div>
        </div>
      </van-sticky>
    </div>
    <router-view></router-view>
  </div>
</template>



<script>
import loadmore from "@/components/LoadMore.vue";

export default {
  components: { loadmore },
  data() {
    return {
      comments:this.$route.query.playlist,
    };
  },
  mounted() {
    // console.log(this.$route.query.playlist);
  },
};
</script>

<style lang="scss" scoped>
// 评论页样式
.comments {
  width: 100%;
  height: 100%;
  position: relative;
  .commentsTop {
    position: fixed;
    width: 100%;
    height: 50px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #fff;

    .left {
      display: flex;
    align-items: center;
      i {
        font-size: 25px;
      }

      span {
        margin-left: 10px;
        font-weight: bold;
      }

      padding: 0 10px;
    }

    .right {
      font-size: 25px;
      padding: 0 10px;
      font-weight: bold;
    }
  }

  .play {
    width: 90%;
    height: 90px;
    padding-top: 75px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    .img {
      flex: 0 0 60px;
      img {
        width: 60px;
        border-radius: 4px;
      }
    }

    .cont {
      margin-left: 10px;
      flex: 1;

      h5 {
        font-weight: bold;
        color: #525050;
      }

      p {
        color: #7c7c7c;

        span {
          font-size: 5px;
          color: #3a73b0;
        }
      }
    }

    .icon {
      flex: 0 0 20px;

      i {
        font-size: 26px;
        color: #b0b0b0;
      }
    }
  }

  .fg {
    margin-top: 25px;
    width: 100%;
    height: 10px;
    background-color: #f6f6f6;
  }

  .commennav {
    width: 100%;

    .butto {
      width: 100%;
    }

    .navitem {
      width: 100%;
      height: 30px;
      line-height: 30px;
      font-size: 14px;
      display: flex;
      justify-content: space-between;
      background-color: #fff;

      .itemleft {
        padding-left: 10px;
        color: #383838;
        font-weight: bold;
      }

      ul {
        display: flex;

        li {
          color: #aaaaaa;
          padding-right: 20px;
        }
      }

      .active {
        color: #353535;
        font-weight: bold;
      }
    }

    .aa {
      height: 5000px;
      background-color: skyblue;
    }
  }
}
</style>